<script setup lang="ts">
import type { ProjectBody } from '@/services/types'
import apis from '../../services/apis'

const props = defineProps<{ body: ProjectBody }>()
// 定义点击事件的处理函数
const handleClick = () => {
  apis.getShareProject({ shareId: props.body.shareId }).send()
}
</script>

<template>
  <div class="project" @click="handleClick()">
    <span class="project-type">{{ body?.type }}</span>
    <div class="project-desc">
      <span>{{ "分享了项目:" }}</span>
      <span class="project-name">{{ body?.name || '未知文件' }}</span>
    </div>
  </div>
</template>
